package com.phison.fenestrapro.dashboard.util;

import com.vaadin.data.validator.AbstractValidator;

/**
 * 
 * 
 * @author Niall O'Hara
 * 
 */
public class RequiredValidator extends AbstractValidator {

	private static final long serialVersionUID = 1L;

	public RequiredValidator(String errorMessage) {
		super(errorMessage);
	}

	public boolean isValid(Object value) {
		if (value == null) {
			return false;
		} else {
			if (value instanceof String) {
				if (((String) value).length() == 0) {
					return false;
				}
			}
			return true;
		}
	}
}